﻿using System;
using System.Web.Mvc;

namespace Press.MVC.Web
{
    public class XmlResult2 : ActionResult
    {
        private object _xml;
        public XmlResult2(object xml)
        {
            _xml = xml;
        }

        public object Xml
        {
            get { return _xml; }
        }

        public override void ExecuteResult(ControllerContext context)
        {
            if (_xml != null)
            {
                context.HttpContext.Response.ContentType = "text/xml";
                context.HttpContext.Response.Write(_xml);
            }
        }
    }
}
